package com.demo2do.sms.entity.sms;

import com.demo2do.core.entity.result.Result;

public class SmsResponse {
    
    /** 云片网返回码 */
    private int code;
    
    /** 云片网返回消息 */
    private String msg;
    
    /** 云片网返回消息描述 */
    private String detail;
    
    /** 接收者号码 */
    private String mobile;
    
    /**
     * The default constructor
     */
    public SmsResponse() {
    }

    /**
     * 
     * @return
     */
    public Result convertResult() {
        Result result = new Result();
        
        if(this.code == 0) {
            result.success().message(SmsStatus.OK.getDescription());
        }else {
            result.fail("500").message(SmsStatus.FAIL.getDescription());
        }
        
        return result;
    }

    /**
     * @return the code
     */
    public int getCode() {
        return code;
    }

    /**
     * @return the msg
     */
    public String getMsg() {
        return msg;
    }

    /**
     * @return the detail
     */
    public String getDetail() {
        return detail;
    }

    /**
     * @return the mobile
     */
    public String getMobile() {
        return mobile;
    }

    /**
     * @param code the code to set
     */
    public void setCode(int code) {
        this.code = code;
    }

    /**
     * @param msg the msg to set
     */
    public void setMsg(String msg) {
        this.msg = msg;
    }

    /**
     * @param detail the detail to set
     */
    public void setDetail(String detail) {
        this.detail = detail;
    }

    /**
     * @param mobile the mobile to set
     */
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
}
